<?php
/**
* Ourteam 
* For linklist module
* Content Mapper
* Real_Data            DB Field
* Name                 name
* position             description
* email                url
* telephone            body2
* fax                  detail_title
* picture              file_id  
*/
class linklist_ourteam {
	function form($object, $config) {
		if (!defined('SYS_FORMS')) require_once(BASE.'subsystems/forms.php');
		exponent_forms_initialize();

		$form = new form();
		if (!isset($object->id)) {
			$object->name = '';
			$object->url = '';
			$object->description = '';
			$object->opennew = 0;
            $object->file_id=0;
            $object->post_date=0;
            $object->detail_title='';
			$object->view_style=0;
		} else {
			$form->meta('id',$object->id);
		}
        //$config->remove_body_html=1;
        $form->register('name','Staff name',new textcontrol($object->name));
        
        $form->register('description','Position',new  textcontrol($object->description));
        
        $form->register('ourteam_education','Education',new  textcontrol($object->ourteam_education));
        
        $form->register('url','Email',new textcontrol($object->url));
        
        $form->register('body2','Telephone',new textcontrol($object->body2));
        
        $form->register('detail_title','Fax',new textcontrol($object->detail_title));
		
        $form->register('team_usedifference_topsrc','Use Difference Top source&nbsp;',new checkboxcontrol($object->team_usedifference_topsrc));
        
		$form->register('file_id','Picture', new ajax_select_file("file_id",0,$object->file_id,true));
        
        $form->register('team_intro','Introduction',new texteditorcontrol($object->team_intro, 4, 70));   
        
        $form->register('team_description','Team Description',new htmleditorcontrol($object->team_description));   
        
		$form->register('submit','',new buttongroupcontrol('Save','','Cancel'));
		return $form;
	}

	function update($values,$object) {
        // name
        $object->name = $values['name'];
        // position
        $object->description = $values['description'];
        //ourteam_education
        $object->ourteam_education = $values['ourteam_education'];
        // email
        $object->url = $values['url'];
        // telephone
        $object->body2 = $values['body2'];
        // fax
		$object->detail_title = $values['detail_title'];
        // picture
        $object->file_id = $values['file_id'];
        
        // for Our team
        $object->team_description =  $values['team_description'];
        $object->team_intro =  $values['team_intro'];
        
        if (isset($values['team_usedifference_topsrc']))
            $object->team_usedifference_topsrc = 1;
        else
            $object->team_usedifference_topsrc = 0;
        
        $object->view_style = 1; // show content
		$object->opennew = (isset($values['opennew']) ? 1 : 0);
		$object->post_date = time();
		return $object;
	}
    
}

?>
